package com.example.fw;

import java.util.Random;

public class RandomGenerator{
		
	public static String generateString(){
		Random rnd = new Random();
		Random rnd1 = new Random();
		String temp = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
		String str = "";
		int random = rnd.nextInt(10);
		for (int i=0;i<random;i++){
			int pos = rnd1.nextInt(temp.length());
			str=str+temp.subSequence(pos, pos+1);
		}
		
		if (random == 0)
			return "";
		else
			return str; 
	}
	
	public static String generateNumber(){
		Random rnd = new Random();
		Random rnd1 = new Random();
		String temp = "0123456789";
		String str = "";
		int random = rnd.nextInt(10);
		for (int i=0;i<random;i++){
			int pos = rnd1.nextInt(temp.length());
			str=str+temp.subSequence(pos, pos+1);
		}
		
		if (random == 0)
			return "";
		else
			return str; 
	}
}
